package kr.hkit.androidcomplete03.ch20;

import kr.hkit.androidcomplete03.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;

public class FragmentReUse extends Activity {
	public final static String TAG = "FragmentCycle";
	FragmentTest fragment;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.fragmentreuse);
	}
	
	public void mClick(View v){
		Intent intent = null;
		Bundle bundle = null;
		fragment = new FragmentTest();
		
		switch(v.getId()){
		
		case R.id.btn_left:
			fragment.num = fragment.num - 1;
			
			Log.d(TAG, String.valueOf(fragment.num));
			break;
			
		case R.id.btn_right:
			fragment.num = fragment.num + 1;
			
			Log.d(TAG, String.valueOf(fragment.num));
			break;
		}
	}
}
